package com.biz.primus.model.sso.auth.vo;

import com.biz.primus.base.enums.CommonStatus;
import com.fasterxml.jackson.annotation.JsonInclude;
import org.apache.commons.lang3.builder.ToStringBuilder;

import java.util.List;

/**
 * Created by younger on 17/11/3.
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
public class MenuItemVO extends AbstractDescribableItem {

    private static final long serialVersionUID = -8167868032358770650L;

    private String icon;

    private String url;

    private GrantedAuthority grantedAuthority;

    private List<ResourceVO> resources;

    public MenuItemVO() {
    }

    public MenuItemVO(String id, String name, String description, String icon, String url, CommonStatus status, Integer orderIndex) {
        super(id, name, description, orderIndex, status);
        this.icon = icon;
        this.url = url;
    }

    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }

    /**
     * {@linkplain MenuItemVO#icon}
     */
    public String getIcon() {
        return icon;
    }

    /**
     * {@linkplain MenuItemVO#icon}
     */
    public void setIcon(String icon) {
        this.icon = icon;
    }

    /**
     * {@linkplain MenuItemVO#url}
     */
    public String getUrl() {
        return url;
    }

    /**
     * {@linkplain MenuItemVO#url}
     */
    public void setUrl(String url) {
        this.url = url;
    }

    /**
     * {@linkplain MenuItemVO#grantedAuthority}
     */
    public GrantedAuthority getGrantedAuthority() {
        return grantedAuthority;
    }

    /**
     * {@linkplain MenuItemVO#grantedAuthority}
     */
    public void setGrantedAuthority(GrantedAuthority grantedAuthority) {
        this.grantedAuthority = grantedAuthority;
    }

    /**
     * {@linkplain MenuItemVO#resources}
     */
    public List<ResourceVO> getResources() {
        return resources;
    }

    /**
     * {@linkplain MenuItemVO#resources}
     */
    public void setResources(List<ResourceVO> resources) {
        this.resources = resources;
    }
}
